-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
decomp: camera
| cam-combiner
| cam-start
| cam-update
#621
Conversation
camera
| cam-combiner
| cam-start
camera
| cam-combiner
| cam-start
| cam-update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
goal_src/engine/camera/cam-start.gc
Outdated
) | ||
(let ((a1-2 cam-combiner-init)) | ||
) | ||
(t9-3 a0-3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, you should case t9-3
to (function process object function)
.
This code;
(let ((a1-2 cam-combiner-init))
)
is the second argument to the function.
goal_src/engine/camera/cam-start.gc
Outdated
(the-as pointer #x70004000) | ||
) | ||
) | ||
(let ((t9-6 (the-as (function process function) set-to-run)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another (function process object function)
goal_src/engine/camera/cam-start.gc
Outdated
) | ||
|
||
;; failed to figure out what this is: | ||
(cam-start #f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect this will cause a crash because of the scratchpad thing. I will work on this: #645
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably causing the crash in tests, you can comment this out with a TODO for now. It's probably calling some function we don't have yet.
goal_src/engine/camera/cam-update.gc
Outdated
) | ||
(vector-normalize! s4-0 1.0) | ||
(let* ((v1-1 s4-0)) | ||
(set! f0-1 (vector-dot v1-1 arg3)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine, but the decompiler could make it look nicer (#636) and hopefully eliminate f0-1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really close, just a few suggestions on types to clean things up
(let ((v1-5 (-> arg0 inv-camera-rot vector 3 quad))) | ||
(set! (-> sv-240 quad) v1-5) | ||
) | ||
(vector-! s2-0 (-> s5-0 yon-top-left) sv-240) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great to see, the vector-!
stuff is working.
goal_src/engine/camera/cam-update.gc
Outdated
(a1-25 (-> *math-camera* guard-plane)) | ||
(a2-21 4.0) | ||
) | ||
(t9-22 a0-58 a1-25 a2-21) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is kinda suspicious, but I think will go away once update-visible
takes 1 arg
goal_src/engine/camera/cam-update.gc
Outdated
(define *update-leaf-when-outside-bsp* #t) | ||
|
||
;; definition for function update-visible | ||
(defun update-visible ((arg0 math-camera) (arg1 int) (arg2 uint) (arg3 uint)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this one actually takes only 1 arg.
goal_src/engine/camera/cam-update.gc
Outdated
) | ||
) | ||
(if (and *stats-bsp* (= *master-mode* 'game)) | ||
(format *stdcon* "~0kleaf-index = ~d~%" (-> s5-1 bsp unk-data-2 0) arg3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably had an error/warning with 1 arg because this format string is incorrectly recognized as taking 2 arguments.
(set! (-> s5-1 all-visible?) #f) | ||
) | ||
(let* ((a0-19 s5-1) | ||
(t9-2 (method-of-object a0-19 dummy-16)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method should take more arguments so it ends up used directly in the when
below
goal_src/engine/camera/cam-update.gc
Outdated
(set! (-> s5-1 all-visible?) #f) | ||
) | ||
(let* ((a0-24 s5-1) | ||
(t9-3 (method-of-object a0-24 dummy-16)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar thing here
goal_src/engine/camera/cam-update.gc
Outdated
;; definition for function update-camera | ||
;; Used lq/sq | ||
(defun update-camera () | ||
(local-vars (a3-12 number)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something is wrong with this variable
goal_src/engine/camera/cam-update.gc
Outdated
(-> *instance-tie-work* guard-plane 3 quad) | ||
(-> *math-camera* guard-plane 3 quad) | ||
) | ||
(update-visible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I think if you remove the extra arguments from update-visible
the weird a3-12
stuff will go away.
goal_src/engine/camera/cam-update.gc
Outdated
(a2-13 (-> *math-camera* inv-camera-rot-smooth-from)) | ||
) | ||
(set! a3-12 (-> *math-camera* smooth-t)) | ||
(t9-16 a0-42 a1-16 a2-13 (the-as float a3-12)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should get less weird once update-visible
is fixed
goal_src/engine/camera/cam-start.gc
Outdated
) | ||
|
||
;; failed to figure out what this is: | ||
(cam-start #f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably causing the crash in tests, you can comment this out with a TODO for now. It's probably calling some function we don't have yet.
No description provided.